package com.itheima.api.hashmap.demo05;

import java.util.HashMap;

public class HashMapDemo01 {

    public static void main(String[] args) {

        Student s1 = new Student("zhangsan", 20);
        Student s2 = new Student("lisi", 18);
        Student s3 = new Student("wangwu", 23);

        HashMap<Student, String> hashMap = new HashMap<Student, String>();

        hashMap.put(s1, "北京");
        hashMap.put(s2, "上海");
        hashMap.put(s3, "深圳");

        hashMap.forEach((key, value) -> System.out.println(key.getName() + "----" + key.getAge() + "----" + value));

    }

}
